package board.command;

import java.awt.*;

import sgf.SGFParseException;

import board.Board;
import board.NodeMark;

/**
 * Command that removes a mark from the Board.
 * @author TKington
 *
 */
public class RemoveMarkCommand extends Command {
	/** The mark that will be removed. */
    private NodeMark mark;
    
    /** 
     * Creates a new instance of RemoveMarkCommand
     * @param mark the mark to be removed
     */
    public RemoveMarkCommand(NodeMark mark) {
        this.mark = mark;
    }
    
    @Override
	public boolean doIt(Board b) {
        b.removeMark(mark);
        return true;
    }
    
    @Override
	public void undoIt(Board b) {
        b.addMark(mark);
    }
    
    @Override
	public Rectangle getBounds() {
        return mark.getBounds();
    }
    
    @Override
	public void validatePoints(int size) throws SGFParseException {
        mark.validatePoints(size);
    }
}
